package com.smart.manager.member.entities.models;

import com.smart.common.entities.core.BaseLongModel;
import com.smart.manager.member.entities.views.MemberView;
import com.smart.manager.product.entities.enums.PigStatus;
import com.smart.manager.product.entities.views.BasicPigstyView;
import com.smart.manager.product.entities.views.BasicRfidView;
import com.smart.manager.product.entities.views.PigBreedView;
import com.smart.manager.product.entities.views.PigLevelView;
import com.smart.manager.work.views.BasicStaffView;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;


/**
 * 猪仔管理  -- 完整的猪
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Accessors(chain = true)
public class MemberMaterialPig extends BaseLongModel {


    @ApiModelProperty("猪仔代码")
    private String code;

    @ApiModelProperty("猪仔名称")
    private String name;

    @ApiModelProperty("猪仔总消费")
    private Integer totalConsume;

    @ApiModelProperty("猪仔详情")
    @ManyToOne
    @JoinColumn(name = "pig_level",referencedColumnName = "id")
    private PigLevelView pigLevel;

    @ApiModelProperty("猪猪备用金")
    private Integer reserveFund;

    @ApiModelProperty("耳标MAC")
    @ManyToOne
    @JoinColumn(name = "rfid",referencedColumnName = "beacon_mac")
    private BasicRfidView rfid;

    @ApiModelProperty("所属玩家")
    @ManyToOne
    @JoinColumn(name = "member" , referencedColumnName = "id")
    private MemberView member;

    @ApiModelProperty("合养玩家")
    @ManyToOne
    @JoinColumn(name = "close_member" , referencedColumnName = "id")
    private MemberView closeMember;

    @ApiModelProperty("所属猪圈")
    @ManyToOne
    @JoinColumn(name = "pigsty",referencedColumnName = "code")
    private BasicPigstyView pigsty;

    @ApiModelProperty("猪仔档案")
    @ManyToOne
    @JoinColumn(name = "breed",referencedColumnName = "code")
    private PigBreedView breed;

    @ApiModelProperty("饲养员")
    @ManyToOne
    @JoinColumn(name = "staff",referencedColumnName = "code")
    private BasicStaffView staff;

    @ApiModelProperty("猪仔状态")
    private PigStatus status;

    @ApiModelProperty("认养赠送(鸡)")
    private Integer chicken;

    @ApiModelProperty("是否全额认养")
    private Boolean isFull = false;

    @ApiModelProperty("入栏日龄")
    private Integer enterAge;

    @ApiModelProperty("显示排序")
    private Integer sort;


}
